# Tree Generation module for CROSS

#########################################################################################
#
# Copyright (C) 2008  
# Authors: Aljosa Osep (aljosa.osep@gmail.com), Jernej Kranjec (jernej.kranjec@gmail.com)
# From Faculty of Electrical Engineering and Computer Science, Maribor, Slovenia
# Done at School of Technology, Seinajoki, Finland
# Under mentor Kimmo Salmenjoki (kimmo.salmenjoki@seamk.fi)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#########################################################################################

# ==================== imports ====================== #
import pygtk			# import pygtk library
pygtk.require('2.0')	# require version 2.o
import gtk				# import gtk

class treeData:

	def __init__(self):
		pass

	def buildTree(self, root, tree, registers):
		
		### General Configuration Tree
		self.genConf = tree.append(root, ['General Configuration', 'none', 0, 0, ''])	# ['Name', 'Register', Start Bit, Control, 'Data String']
		
		### Protocol Configuration Tree
		self.proConf = tree.append(root, ['Protocol Configuration', 'none', 0, 0, ''])	# ['Name', 'Register', Start Bit, Control, 'Data String']
		
		for regActive in registers:
				
			### General Configuration Part
			
			if regActive == 'GCW':
				
				## Operating Mode - General Configuration Word Tree
				self.genConGCW = tree.append(self.genConf, ['General Configuration Word (GCW)', 'none', 0, 0, ''])
				
				# General Configuration Word - Serial Mode
				tree.append(self.genConGCW, ['Serial Mode', 'GCW', 0, 1, ''])
				
				# General Configuration Word - RF Mode
				tree.append(self.genConGCW, ['RF Mode', 'GCW', 1, 1, ''])
				
				# General Configuration Word - RF On
				tree.append(self.genConGCW, ['RF On', 'GCW', 2, 1, ''])
				
				# General Configuration Word - Number of Retries for Other Tag Operations
				tree.append(self.genConGCW, ['Number of Retries for Other Tag Operations', 'GCW', 8, 3, '4'])
				
				# General Configuration Word - Number of Retries for Tag Invertory
				tree.append(self.genConGCW, ['Number of Retries for Tag Invertory', 'GCW', 12, 3, '4'])

			elif regActive == 'SCW':
				
				## Serial Communications - Serial Configuration Word Tree
				self.genConSCW = tree.append(self.genConf, ['Serial Configuration Word (SCW)', 'none', 0, 0, ''])
				
				# Serial Configuration Word - Baud Rate
				tree.append(self.genConSCW, ['Baud Rate', 'SCW', 0, 2, '3;1200:000;2400:001;4800:010;9600:011;19,2K:100;38,4K:101;57,6K:110;'])
				
				# Serial Configuration Word - Stop Bits
				tree.append(self.genConSCW, ['Stop Bits', 'SCW', 3, 1, ''])
				
				# Serial Configuration Word - Data Bits
				tree.append(self.genConSCW, ['Data Bits', 'SCW', 4, 1, ''])
				
				# Serial Configuration Word - Parity
				tree.append(self.genConSCW, ['Parity', 'SCW', 5, 2, '2;None:00;Odd:01;Even:10;'])
				
				# Serial Configuration Word - Echo
				tree.append(self.genConSCW, ['Echo', 'SCW', 7, 1, ''])
			elif regActive == 'SMA':
				
				## Serial Communications - Serial Multidrom Adress Tree
				self.genConSMA = tree.append(self.genConf, ['Serial Multidrom Adress (SMA)', 'none', 0, 0, ''])
				
				# Serial Multidrom Adress - Serial Multidrop Address
				tree.append(self.genConSMA, ['Serial Multidrop Address', 'SMA', 0, 3, '8'])
			
			elif regActive == 'MCW':
				
				## Receiver - Multiplexor Configuration Word Tree
				self.genConMCW = tree.append(self.genConf, ['Multiplexor Configuration Word (MCW)', 'none', 0, 0, ''])
				
				# Multiplexor Configuration Word - Suppress MUX
				tree.append(self.genConMCW, ['Suppress MUX', 'MCW', 0, 1, ''])
				
				# Multiplexor Configuration Word - Suppress MUX Fail Msg
				tree.append(self.genConMCW, ['Suppress MUX Fail Msg', 'MCW', 1, 1, ''])
				
				# Multiplexor Configuration Word - Inventory Count
				tree.append(self.genConMCW, ['Inventory Count', 'MCW', 8, 3, '8'])
				
				# Multiplexor Configuration Word - Number of Antennas
				tree.append(self.genConMCW, ['Inventory Count', 'MCW', 16, 3, '8'])
				
			elif regActive == 'MSW':
				
				## Receiver - Multiplexor Select Word Tree
				self.genConMSW = tree.append(self.genConf, ['Multiplexor Select Word (MSW)', 'none', 0, 0, ''])
				
				# Multiplexor Select Word - First Antenna Number
				tree.append(self.genConMSW, ['First Antenna Number', 'MSW', 0, 3, '7'])
				
				# Multiplexor Select Word - Antenna Select
				tree.append(self.genConMSW, ['First Antenna Select', 'MSW', 7, 1, ''])
				
				# Multiplexor Select Word - Second Antenna Number
				tree.append(self.genConMSW, ['Second Antenna Number', 'MSW', 0, 8, '7'])
				
				# Multiplexor Select Word - Antenna Select
				tree.append(self.genConMSW, ['Second Antenna Select', 'MSW', 15, 1, ''])
				
				# Multiplexor Select Word - Third Antenna Number
				tree.append(self.genConMSW, ['Third Antenna Number', 'MSW', 0, 16, '7'])
				
				# Multiplexor Select Word - Antenna Select
				tree.append(self.genConMSW, ['Third Antenna Select', 'MSW', 23, 1, ''])
				
				# Multiplexor Select Word - Fourth Antenna Number
				tree.append(self.genConMSW, ['Fourth Antenna Number', 'MSW', 0, 24, '7'])
				
				# Multiplexor Select Word - Antenna Select
				tree.append(self.genConMSW, ['Fourth Antenna Select', 'MSW', 31, 1, ''])
				
			elif regActive == 'PCW':
				
				## Operating Mode - Protocol Configuration Word Tree
				self.genConPCW = tree.append(self.genConf, ['Protocol Configuration Word (PCW)', 'none', 0, 0, ''])
				
				# Protocol Configuration Word - Tag Alert
				tree.append(self.genConPCW, ['Tag Alert', 'PCW', 8, 1, ''])
				
				# Protocol Configuration Word - Tag Digital I/O
				tree.append(self.genConPCW, ['Tag Digital I/O', 'PCW', 9, 1, ''])
				
				# Protocol Configuration Word - Tag RF I/O
				tree.append(self.genConPCW, ['Tag RF I/O', 'PCW', 10, 1, ''])
				
				# Protocol Configuration Word - RF Gate
				tree.append(self.genConPCW, ['RF Gate', 'PCW',13, 1, ''])
				
				# Protocol Configuration Word - Queue Tag Inventory
				tree.append(self.genConPCW, ['RF Gate', 'PCW',16, 1, ''])
				
				# Protocol Configuration Word - Antenna Report
				tree.append(self.genConPCW, ['RF Gate', 'PCW',20, 1, ''])
				
				# Protocol Configuration Word - Inventory Report Interval
				tree.append(self.genConPCW, ['Inventory Report Interval', 'PCW',24, 3, '4'])
				
			elif regActive == 'PSW':
			
				## Operating Mode - Protocol Select Word Tree
				self.genConPSW = tree.append(self.genConf, ['Protocol Select Word (PSW)', 'none', 0, 0, ''])
				
				### --- Supported by MP9111 and MP9121 --- ###
				# Protocol Select Word - EMM 4102
				tree.append(self.genConPSW, ['EMM 4102', 'PSW', 0, 1, ''])
				
				# Protocol Select Word - EMM 4025 23cpd
				tree.append(self.genConPSW, ['EMM 4025 23cpd', 'PSW', 1, 1, ''])
				
				# Protocol Select Word - Philips HiTag1
				tree.append(self.genConPSW, ['Philips HiTag1', 'PSW', 2, 1, ''])
				
				# Protocol Select Word - Temic (Atmel) e555x
				tree.append(self.genConPSW, ['Temic (Atmel) e555x', 'PSW', 4, 1, ''])
				
				### --- Supported by MP9112 --- ###
				# Protocol Select Word - Texas Instruments TIRIS
				tree.append(self.genConPSW, ['Texas Instruments TIRIS', 'PSW', 3, 1, ''])
				
				### --- Supported by MP9210 --- ###
				# Protocol Select Word - Texas Instruments TagIt
				tree.append(self.genConPSW, ['Texas Instruments TagIt', 'PSW', 5, 1, ''])
				
				# Protocol Select Word - ISO 15693
				tree.append(self.genConPSW, ['ISO 15693', 'PSW', 6, 1, ''])
				
				# Protocol Select Word - I-CODE (Philips 13.56)
				tree.append(self.genConPSW, ['I-CODE (Philips 13.56)', 'PSW', 8, 1, ''])
				
				# Protocol Select Word - Philips EPC
				tree.append(self.genConPSW, ['Philips EPC', 'PSW', 9, 1, ''])
				
				### --- Supported by MP9320 --- ###
				# Protocol Select Word - ISO 18000-6A
				tree.append(self.genConPSW, ['ISO 18000-6A', 'PSW', 10, 1, ''])
				
				# Protocol Select Word - ISO 18000-6B
				tree.append(self.genConPSW, ['ISO 18000-6B', 'PSW', 11, 1, ''])
				
				# Protocol Select Word - Super Tag
				tree.append(self.genConPSW, ['Super Tag', 'PSW', 12, 1, ''])
				
				# Protocol Select Word - EPC 1
				tree.append(self.genConPSW, ['EPC 1', 'PSW', 13, 1, ''])
				
				# Protocol Select Word - EPC 0
				tree.append(self.genConPSW, ['EPC 0', 'PSW', 14, 1, ''])
				
			elif regActive == 'PIO':
				
				## Operating Mode - Protocol Digital I/O Control Tree
				self.genConPIO = tree.append(self.genConf, ['Protocol Digital I/O Control (PIO)', 'none', 0, 0, ''])
				
				# Protocol Digital I/O Control - Tag Digital I/O Pulse Length
				tree.append(self.genConPIO, ['Tag Digital I/O Pulse Length', 'PIO', 0, 3, '8'])
				
			elif regActive == 'CNR':
				## Receiver - Self Training Control Word Tree
				self.genConCNR = tree.append(self.genConf, ['Self Training Control (CNR)', 'none', 0, 0, ''])
				
				# Self Training Control Word - CNR Training Mode
				tree.append(self.genConCNR, ['Training Mode', 'CNR', 0, 2, '4;CNR Disabled:0000;Training Initiated Only via MT:0001;Training Initiated Once:0010;Training Initiated Each Time:0011;'])
				
			elif regActive == 'TBL':
				
				## Transmitter - Transmitter Listen Before Talk Tree
				self.genConTLB = tree.append(self.genConf, ['Transmitter Listen Before Talk (TBL)', 'none', 0, 0, ''])
				
				# Transmitter Listen Before Talk - Idle Channel Detect Treshold
				tree.append(self.genConTBL, ['Idle Channel Detect Treshold', 'TBL', 0, 3, '8'])
				
				# Transmitter Listen Before Talk - Verbosity Level
				tree.append(self.genConTBL, ['Verbosity Level', 'TBL', 0, 28, '4;All Channel Status inhibit:0000;Generate Channel Status per Category:0001;Generate Channel Status per Channel:0010;'])
				
		#	Only avaible on MP9320, no device or documentation for testing and implementing
		#	
		#	elif regActive == 'RDI':
		#		## Receiver - Receiver I Channel Control Word Tree
		#		self.genConRDI = tree.append(self.genConf, ['Receiver I Channel Control (RDI)', 'none', 0, 0, ''])
		#	
		#	elif regActive == 'RDQ':
		#		## Receiver - Receiver Q Channel Control Word Tree
		#		self.genConRDQ = tree.append(self.genConf, ['Receiver Q Channel Control (RDQ)', 'none', 0, 0, ''])
		#	
		#	elif regActive == 'TCP':
		#		## Transmitter - Transmitter Power Configuration Tree
		#		self.genConTPC = tree.append(self.genConf, ['Transmitter Power Configuration (TPC)', 'none', 0, 0, ''])
		#	
		#	elif regActive == 'TP0':
		#		## Transmitter - Transmitter Power Antenna 0 Tree
		#		self.genConTP0 = tree.append(self.genConf, ['Transmitter Power Antenna 0 (TP0)', 'none', 0, 0, ''])
		#	
		#	elif regActive == 'TP1':
		#		## Transmitter - Transmitter Power Antenna 1 Tree
		#		self.genConTP1 = tree.append(self.genConf, ['Transmitter Power Antenna 1 (TP1)', 'none', 0, 0, ''])
		#	
		#	elif regActive == 'TP2':
		#		## Transmitter - Transmitter Power Antenna 2 Tree
		#		self.genConTP2 = tree.append(self.genConf, ['Transmitter Power Antenna 2 (TP2)', 'none', 0, 0, ''])
		#	
		#	elif regActive == 'TP3':
		#		## Transmitter - Transmitter Power Antenna 3 Tree
		#		self.genConTP3 = tree.append(self.genConf, ['Transmitter Power Antenna 3 (TP3)', 'none', 0, 0, ''])
		#	
		#	elif regActive == 'VF0':
		#		## Transmitter - Valid Frequency Set 0 Tree
		#		self.genConVF0 = tree.append(self.genConfTransmitter, ['Valid Frequency Set 0 (VF0)', 'none', 0, 0, ''])
		#		
		#	elif regActive == 'VF1':
		#		## Transmitter - Valid Frequency Set 1 Tree
		#		self.genConVF1 = tree.append(self.genConfTransmitter, ['Valid Frequency Set 1 (VF1)', 'none', 0, 0, ''])
		#		
		#	elif regActive == 'VF2':
		#		## Transmitter - Valid Frequency Set 2 Tree
		#		self.genConVF2 = tree.append(self.genConfTransmitter, ['Valid Frequency Set 2 (VF2)', 'none', 0, 0, ''])
		#		
		#	elif regActive == 'VF3':
		#		## Transmitter - Valid Frequency Set 3 Tree
		#		self.genConVF3 = tree.append(self.genConfTransmitter, ['Valid Frequency Set 3 (VF3)', 'none', 0, 0, ''])
		#		
		#	elif regActive == 'VF4':
		#		## Transmitter - Valid Frequency Set 4 Tree
		#		self.genConVF4 = tree.append(self.genConfTransmitter, ['Valid Frequency Set 4 (VF4)', 'none', 0, 0, ''])
		
			### Protocol Configuration
			
			elif regActive == 'PHT':
				
				### Protocol Configuration - Philips HITAG 1 Tree
				self.proConPHT = tree.append(self.proConf, ['Philips HITAG 1 (PHT)', 'none', 0, 0, ''])
				
				# Philips HITAG 1 - LS Byte First
				tree.append(self.proConPHT, ['LS Byte First', 'PHT', 4, 1, ''])
				
				# Philips HITAG 1 - LS Bit First
				tree.append(self.proConPHT, ['LS Bit First', 'PHT', 5, 1, ''])
				
				# Philips HITAG 1 - Auto Quiet
				tree.append(self.proConPHT, ['Auto Quiet', 'PHT', 7, 1, ''])
				
			elif regActive == 'PPI':
				
				### Protocol Configuration - Philips I-Code (HF) Tree
				self.proConPPI = tree.append(self.proConf, ['Philips I-Code (HF) (PPI)', 'none', 0, 0, ''])
				
				# Philips I-Code (HF) - Timeslots
				tree.append(self.proConPPI, ['Timeslots', 'PPI', 0, 3, '3'])
				
				# Philips I-Code (HF) - LS Byte First
				tree.append(self.proConPPI, ['LS Byte First', 'PPI', 4, 1, ''])
				
				# Philips I-Code (HF) - LS Bit First
				tree.append(self.proConPPI, ['LS Bit First', 'PPI', 5, 1, ''])
				
				# Philips I-Code (HF) - Get Tag Info
				tree.append(self.proConPPI, ['Get Tag Info', 'PPI', 6, 1, ''])
				
				# Philips I-Code (HF) - Auto Quiet
				tree.append(self.proConPPI, ['Auto Quiet', 'PPI', 7, 1, ''])
				
			elif regActive == 'PEP':
				
				### Protocol Configuration - Philips I-Code EPC (HF) Tree
				self.proConPEP = tree.append(self.proConf, ['Philips I-Code EPC (HF) (PEP)', 'none', 0, 0, ''])
				
				# Philips I-Code EPC (HF) - Timeslots
				tree.append(self.proConPEP, ['Timeslots', 'PEP', 0, 3, '4'])
				
				# Philips I-Code EPC (HF) - LS Byte First
				tree.append(self.proConPEP, ['LS Byte First', 'PEP', 4, 1, ''])
				
				# Philips I-Code EPC (HF) - LS Bit First
				tree.append(self.proConPEP, ['LS Bit First', 'PEP', 5, 1, ''])
				
				# Philips I-Code EPC (HF) - Display Tag Info
				tree.append(self.proConPEP, ['Display Tag Info', 'PEP', 6, 1, ''])
				
				# Philips I-Code EPC (HF) - Auto Quiet
				tree.append(self.proConPEP, ['Auto Quiet', 'PEP', 7, 1, ''])
				
			elif regActive == 'PTA':
				
				### Protocol Configuration - TI Tag-it (tm) Tree
				self.proConPTA = tree.append(self.proConf, ['TI Tag-it (tm) (PTA)', 'none', 0, 0, ''])
				
				# TI Tag-it (tm) - LS Byte First
				tree.append(self.proConPTA, ['LS Byte First', 'PTA', 4, 1, ''])
				
				# TI Tag-it (tm) - LS Bit First
				tree.append(self.proConPTA, ['LS Bit First', 'PTA', 5, 1, ''])
				
				# TI Tag-it (tm) - Get Tag Info
				tree.append(self.proConPTA, ['Get Tag Info', 'PTA', 6, 1, ''])
				
				# TI Tag-it (tm) - Auto Quiet
				tree.append(self.proConPTA, ['Auto Quiet', 'PTA', 7, 1, ''])
				
			elif regActive == 'PET':
				
				### Protocol Configuration - Atmel TEMIC Tree
				self.proConPET = tree.append(self.proConf, ['Atmel TEMIC (PET)', 'none', 0, 0, ''])
				
				# Atmel TEMIC - TEMIC_MAXBLK
				tree.append(self.proConPET, ['TEMIC_MAXBLK', 'PET', 0, 3, '3'])
				
				# Atmel TEMIC - TEMIC_AUTO_CONFIG
				tree.append(self.proConPET, ['TEMIC_AUTO_CONFIG', 'PET', 4, 1, ''])
				
			elif regActive == 'PTI':
				
				### Protocol Configuration - TI TIRIS Tree
				self.proConPTI = tree.append(self.proConf, ['TI TIRIS (PTI)', 'none', 0, 0, ''])
				
				# TI TIRIS - TEMIC_MAXBLK
				tree.append(self.proConPTI, ['TEMIC_MAXBLK', 'PTI', 0, 3, '3'])
				
				# TI TIRIS - TEMIC_AUTO_CONFIG
				tree.append(self.proConPTI, ['TEMIC_AUTO_CONFIG', 'PTI', 4, 1, ''])
				
			elif regActive == 'P15':
				
				### Protocol Configuration - ISO 15693 Tree
				self.proConP15 = tree.append(self.proConf, ['ISO 15693 (P15)', 'none', 0, 0, ''])
				
				# ISO 15693 - Timeslots
				tree.append(self.proConP15, ['Timeslots', 'P15', 0, 3, '1'])
				
				# ISO 15693 - LS Byte First
				tree.append(self.proConP15, ['LS Byte First', 'P15', 4, 1, ''])
				
				# ISO 15693 - LS Bit First
				tree.append(self.proConP15, ['LS Bit First', 'P15', 5, 1, ''])
				
				# ISO 15693 - Get Tag Info
				tree.append(self.proConP15, ['Get Tag Info', 'P15', 6, 1, ''])
				
				# ISO 15693 - Auto Quiet
				tree.append(self.proConP15, ['Auto Quiet', 'P15', 7, 1, ''])
				
			elif regActive == 'P6A':
				
				### Protocol Configuration - ISO 1800-6A Tree
				self.proConP6A = tree.append(self.proConf, ['ISO 1800-6A (P6A)', 'none', 0, 0, ''])
				
				# ISO 1800-6A - PA Send SUID
				tree.append(self.proConP6A, ['PA Send SUID', 'P6A', 2, 1, ''])
				
				# ISO 1800-6A - PA UsePrime
				tree.append(self.proConP6A, ['PA UsePrime', 'P6A', 5, 1, ''])
				
				# ISO 1800-6A - PA FSTMode
				tree.append(self.proConP6A, ['PA FSTMode', 'P6A', 6, 1, ''])
				
				# ISO 1800-6A - PFST Send Mute
				tree.append(self.proConP6A, ['PFST Send Mute', 'P6A', 7, 1, ''])
				
				# ISO 1800-6A - PA Roundslots
				tree.append(self.proConP6A, ['PA Roundslots', 'P6A', 8, 3, '8'])
				
				# ISO 1800-6A - Application Family Identifier
				tree.append(self.proConP6A, ['Application Family Identifier', 'P6A', 16, 3, '8'])
				
				# ISO 1800-6A - Slot Closure
				tree.append(self.proConP6A, ['Slot Closure', 'P6A', 27, 1, ''])
				
				# ISO 1800-6A - Enable Filtering
				tree.append(self.proConP6A, ['Enable Filtering', 'P6A', 28, 1, ''])
				
				# ISO 1800-6A - Enable EM4223 160 kb/s
				tree.append(self.proConP6A, ['Enable EM4223 160 kb/s', 'P6A', 29, 1, ''])
				
				# ISO 1800-6A - Adaptive Rnd Size
				tree.append(self.proConP6A, ['Adaptive Rnd Size', 'P6A', 30, 1, ''])
				
				# ISO 1800-6A - Auto Quiet
				tree.append(self.proConP6A, ['Auto Quiet', 'P6A', 31, 1, ''])
				
			elif regActive == 'TMA':
				
				### Protocol Configuration - ISO 1800-6A Transmit Modulation Control Tree
				self.proConTMA = tree.append(self.proConf, ['ISO 1800-6A Transmit Modulation Control (TMA)', 'none', 0, 0, ''])
				
				# ISO 1800-6A Transmit Modulation Control - Modulation Depth
				tree.append(self.proConTMA, ['Modulation Depth', 'TMA', 0, 2, '3;99%:000;75%:001;50%:010;30%:011;20%:100;11%:101;'])
				
			elif regActive == 'PAA':
				
				### Protocol Configuration - ISO 1800-6A Adaptive Round Sizing Tree
				self.proConPAA = tree.append(self.proConf, ['ISO 1800-6A Adaptive Round Sizing (PAA)', 'none', 0, 0, ''])
				
				# ISO 1800-6A Adaptive Round Sizing - STP
				tree.append(self.proConPAA, ['STP', 'PAA', 0, 2, '4;No Increment:0000;Increment Round Size by 1^2:0001;Increment Round Size by 2^2:0010;Increment Round Size by 3^2:0011;'])
				
				# ISO 1800-6A Adaptive Round Sizing - IRS
				tree.append(self.proConPAA, ['IRS', 'PAA', 4, 2, '4;Initial Round Size of 8:0000;Initial Round Size of 16:0001;Initial Round Size of 32:0010;Initial Round Size of 64:0011;Initial Round Size of 128:0100;'])
				
				# ISO 1800-6A Adaptive Round Sizing - MRS
				tree.append(self.proConPAA, ['MRS', 'PAA', 8, 2, '4;Minimal Round Size of 8:0000;Minimal Round Size of 16:0001;Minimal Round Size of 32:0010;Minimal Round Size of 64:0011;Minimal Round Size of 128:0100;'])
				
				# ISO 1800-6A Adaptive Round Sizing - VTN
				tree.append(self.proConPAA, ['VTN', 'PAA', 12, 3, '4'])
				
				# ISO 1800-6A Adaptive Round Sizing - VTI
				tree.append(self.proConPAA, ['VTI', 'PAA', 16, 3, '4'])
				
				# ISO 1800-6A Adaptive Round Sizing - VTD
				tree.append(self.proConPAA, ['VTD', 'PAA', 20, 3, '4'])
				
				# ISO 1800-6A Adaptive Round Sizing - WSI
				tree.append(self.proConPAA, ['WSI', 'PAA', 24, 3, '4'])
				
				# ISO 1800-6A Adaptive Round Sizing - WSD
				tree.append(self.proConPAA, ['WSD', 'PAA', 28, 3, '4'])
				
			elif regActive == 'PAL':
				
				### Protocol Configuration - ISO 1800-6A Pattern Length and Offset Tree
				self.proConPAL = tree.append(self.proConf, ['ISO 1800-6A Pattern Length and Offset (PAL)', 'none', 0, 0, ''])
				
				# ISO 1800-6A Pattern Length and Offset - Pattern Length
				tree.append(self.proConPAL, ['Pattern Length', 'PAL', 0, 3, '8'])
			
			### PA0 - PA7 registers are not implemented due to required padding
			
			elif regActive == 'P6S':
				
				### Protocol Configuration - ISO 1800-6B Selection Configuration Tree
				self.proConP6S = tree.append(self.proConf, ['ISO 1800-6B Selection Configuration (P6S)', 'none', 0, 0, ''])
				
				# ISO 1800-6B Selection Configuration - Select Command Opcode
				tree.append(self.proConP6S, ['Select Command Opcode', 'P6S', 0, 3, '8'])
				
				# ISO 1800-6B Selection Configuration - Select Command Address Value
				tree.append(self.proConP6S, ['Select Command Address Value', 'P6S', 8, 3, '8'])
				
				
				# ISO 1800-6B Selection Configuration - Select Command Mask Value
				tree.append(self.proConP6S, ['Select Command Mask Value', 'P6S', 16, 3, '8'])
				
				
				# ISO 1800-6B Selection Configuration - Auto Quiet
				tree.append(self.proConP6S, ['Auto Quiet', 'P6S', 31, 1, ''])
				
			### P6H & P6L registers are not implemented due to missing aditiona documentation
			
			elif regActive == 'P6B':
				
				### Protocol Configuration - UCODE V1.19 Enable 4X Return Link Word Tree
				self.proConP6B = tree.append(self.proConf, ['UCODE V1.19 Enable 4X Return Link Word (P6B)', 'none', 0, 0, ''])
				
				# UCODE V1.19 Enable 4X Return Link Word - Enable V1.19
				tree.append(self.proConP6B, ['Enable V1.19', 'P6B', 1, 1, ''])
				
				# UCODE V1.19 Enable 4X Return Link Word - V1.19 EPC Bit Length
				tree.append(self.proConP6B, ['V1.19 EPC Bit Length', 'P6B', 2, 1, ''])
				
			elif regActive == 'P6U':
				
				### Protocol Configuration - ISO 1800-6B Unselection Configuration Word Tree
				self.proConP6U = tree.append(self.proConf, ['ISO 1800-6B Unselection Configuration Word (P6U)', 'none', 0, 0, ''])
				
				# ISO 1800-6B Unselection Configuration Word - Unselect Command Opcode
				tree.append(self.proConP6U, ['Unselect Command Opcode', 'P6U', 0, 3, '8'])
				
				# ISO 1800-6B Unselection Configuration Word - Unselect Command Address Value
				tree.append(self.proConP6U, ['Unselect Command Address Value', 'P6U', 8, 3, '8'])
				
				
				# ISO 1800-6B Unselection Configuration Word - Unselect Command Mask Value
				tree.append(self.proConP6U, ['Unselect Command Mask Value', 'P6U', 16, 3, '8'])
			
			### P60 & P61 registers are not implemented due to missing aditiona documentation
			
			elif regActive == 'TMB':
				
				### Protocol Configuration - ISO 1800-6B Transmit Modulation Control Tree
				self.proConTMB = tree.append(self.proConf, ['ISO 1800-6A Transmit Modulation Control (TMB)', 'none', 0, 0, ''])
				
				# ISO 1800-6B Transmit Modulation Control - Modulation Depth
				tree.append(self.proConTMB, ['Modulation Depth', 'TMB', 0, 2, '3;99%:000;75%:001;50%:010;30%:011;20%:100;11%:101;'])
				
				# ISO 1800-6B Transmit Modulation Control - Use Fast Shaper
				tree.append(self.proConTMB, ['Use Fast Shaper', 'TMB', 4, 1, ''])
				
			elif regActive == 'PEC':
				
				### Protocol Configuration - EPC Protocol Configuration Tree
				self.proConPEC = tree.append(self.proConf, ['EPC Protocol Configuration (PEC)', 'none', 0, 0, ''])
				
				# EPC Protocol Configuration - EPC 1 Bit Length
				tree.append(self.proConPEC, ['EPC 1 Bit Length', 'PEC', 4, 2, '4;64 bits:0000;96 Bits:0001;126 Bits: 0010'])
				
				# EPC Protocol Configuration - Optimize EPC 1 for Large Populations
				tree.append(self.proConPEC, ['Optimize EPC 1 for Large Populations', 'PEC', 9, 1, ''])
				
				# EPC Protocol Configuration - Auto Quiet
				tree.append(self.proConPEC, ['Auto Quiet', 'PEC', 13, 1, ''])
				
			elif regActive == 'PE0':
				
				### Protocol Configuration - EPC0 Protocol Configuration Word Tree
				self.proConPE0 = tree.append(self.proConf, ['EPC0 Protocol Configuration Word (PE0)', 'none', 0, 0, ''])
				
				# EPC0 Protocol Configuration - Enable 16 bit Detect
				tree.append(self.proConPE0, ['Enable 16 bit Detect', 'PE0', 0, 1, ''])
				
				# EPC0 Protocol Configuration - Enable 64 bit Detect
				tree.append(self.proConPE0, ['Enable 64 bit Detect', 'PE0', 2, 1, ''])
				
				# EPC0 Protocol Configuration - Enable 96 bit Detect
				tree.append(self.proConPE0, ['Enable 96 bit Detect', 'PE0', 3, 1, ''])
				
				# EPC0 Protocol Configuration - Enable Auto Detec Length
				tree.append(self.proConPE0, ['Enable Auto Detect Length', 'PE0', 7, 1, ''])
				
				# EPC0 Protocol Configuration - Scroll First
				tree.append(self.proConPE0, ['Scroll First', 'PE0', 8, 1, ''])
				
				# EPC0 Protocol Configuration - Proprietary EPC0 Read/Write Extension
				tree.append(self.proConPE0, ['Proprietary EPC0 Read/Write Extension', 'PE0', 10, 2, '2;Matrics Write:00;Impinj Write:01;'])
				
				# EPC0 Protocol Configuration - Tag Inventory Retry Count
				tree.append(self.proConPE0, ['Tag Inventory Retry Count', 'PE0', 12, 3, '3'])
				
				# EPC0 Protocol Configuration - Second Short W3
				tree.append(self.proConPE0, ['Second Short W3', 'PE0', 15, 1, ''])
				
				# EPC0 Protocol Configuration - Tag Command Retry Count
				tree.append(self.proConPE0, ['Tag Command Retry Count', 'PE0', 16, 3, '3'])
				
				# EPC0 Protocol Configuration - IDBlocks
				tree.append(self.proConPE0, ['IDBlocks', 'PE0', 24, 3, '3'])
				
				# EPC0 Protocol Configuration - Display CRC on Inventory
				tree.append(self.proConPE0, ['Display CRC on Inventory', 'PE0', 27, 1, ''])
				
				# EPC0 Protocol Configuration - IDMode
				tree.append(self.proConPE0, ['IDMode', 'PE0', 28, 2, '2;ID0:01;ID1:10;ID2:00;ID2:11;'])
				
				# EPC0 Protocol Configuration - Inhibit ID2
				tree.append(self.proConPE0, ['Inhibit ID2', 'PE0', 30, 1, ''])
				
				# EPC0 Protocol Configuration - Enable EPC0 Filtering
				tree.append(self.proConPE0, ['Enable EPC0 Filtering', 'PE0', 31, 1, ''])
				
			elif regActive == 'P0L':
				
				### Protocol Configuration - EPC0 Pattern Lenght and Offset Tree
				self.proConP0L = tree.append(self.proConf, ['EPC0 Pattern Lenght and Offset (P0L)', 'none', 0, 0, ''])
				
				# EPC0 Pattern Lenght and Offset - Pattern Length
				tree.append(self.proConP0L, ['Pattern Length', 'P0L', 0, 3, '8'])
				
				# EPC0 Pattern Lenght and Offset - Pattern Offset
				tree.append(self.proConP0L, ['Pattern Offset', 'P0L', 8, 3, '8'])
			
			### P00 - P07 registers are not implemented due to required padding
				
			elif regActive == 'PE1':
				
				### Protocol Configuration - EPC1 Protocol Configuration Tree
				self.proConPE1 = tree.append(self.proConf, ['EPC0 Protocol Configuration Word (PE1)', 'none', 0, 0, ''])
				
				# EPC0 Protocol Configuration - Enable 64 bit Detect
				tree.append(self.proConPE1, ['Enable 64 bit Detect', 'PE1', 2, 1, ''])
				
				# EPC0 Protocol Configuration - Enable 96 bit Detect
				tree.append(self.proConPE1, ['Enable 96 bit Detect', 'PE1', 3, 1, ''])
				
				# EPC0 Protocol Configuration - Enable Auto Detec Length
				tree.append(self.proConPE1, ['Enable Auto Detect Length', 'PE1', 7, 1, ''])
				
				# EPC0 Protocol Configuration - Scroll First
				tree.append(self.proConPE1, ['Scroll First', 'PE1', 9, 1, ''])
				
				# EPC0 Protocol Configuration - Use Software CRC
				tree.append(self.proConPE1, ['Use Software CRC', 'PE1', 10, 1, ''])
				
				# EPC0 Protocol Configuration - Auto Quiet
				tree.append(self.proConPE1, ['Auto Quiet', 'PE1', 13, 1, ''])
				
				# EPC0 Protocol Configuration - Enable EPC1 Filtering
				tree.append(self.proConPE1, ['Enable EPC1 Filtering', 'PE1', 31, 1, ''])
				
			elif regActive == 'P1L':
				
				### Protocol Configuration - EPC1 Pattern Lenght and Offset Tree
				self.proConP1L = tree.append(self.proConf, ['EPC1 Pattern Lenght and Offset (P1L)', 'none', 0, 0, ''])
				
				# EPC1 Pattern Lenght and Offset - Pattern Length
				tree.append(self.proConP1L, ['Pattern Length', 'P1L', 0, 3, '8'])
				
				# EPC1 Pattern Lenght and Offset - Pattern Offset
				tree.append(self.proConP1L, ['Pattern Offset', 'P1L', 8, 3, '8'])
				
			### P10 - P17 registers are not implemented due to required padding
			
			elif regActive == 'TM1':
				
				### Protocol Configuration - EPC1 Transmit Modulation Control Tree
				self.proConTM1 = tree.append(self.proConf, ['EPC1 Transmit Modulation Control (TM1)', 'none', 0, 0, ''])
				
				# EPC1 Transmit Modulation Control - Modulation Depth
				tree.append(self.proConTMB, ['Modulation Depth', 'TM1', 0, 2, '3;99%:000;75%:001;50%:010;30%:011;20%:100;11%:101;'])
				
			elif regActive == 'PST':
				
				### Protocol Configuration - Supertag Protocol Configuration Tree
				self.proConPST = tree.append(self.proConf, ['Supertag Protocol Configuration (PST)', 'none', 0, 0, ''])
				
				# Supertag Protocol Configuration - Acknowledgement
				tree.append(self.proConPST, ['Acknowledgement', 'PST', 0, 1, ''])	
				
				# Supertag Protocol Configuration - Mute
				tree.append(self.proConPST, ['Mute', 'PST', 1, 1, ''])	
				
		#	Protocol unlocking function not implemented
		#	## Operating Moden - Protocol Select Mask Tree
		#	self.genConPSM = tree.append(self.genConfOperatingMode, ['Protocol Select Mask (PSM)', 'none', 0, 0, ''])
		
configTree = treeData()
